package tolgahan.albayrak.as3.reflection
{
	public class StaticMethodInfo extends MethodInfo
	{
		public function StaticMethodInfo(xml:XML, baseType:Type, memberIndex:uint)
		{
			super(xml, baseType, memberIndex);
		}
		override public function invoke(source:Object, ...args) : *
		{
			if(validate(args))
				return _baseType.classReference[_name].apply(null, getParameters(args));
		}
		
		override public function toString():String
		{
			if(_returnType)
				return "public static function " + _name + "(" + _parameters + "):" + _returnType + "\n\t\t{\n\t\t\treturn default(" + _returnType + ")\n\t\t}";
			return "public static function " + _name + "(" + _parameters + "):void\n\t\t{\n\t\t}";
		}
	}
}